const s = n => n.replace(/^(?!$)(?: $)?/gm, '#');
function r(n, e) {
  return /^\n+$/.test(n) ? n.substring(1) : e ? n.replace(/^(?! *$)/gm, e) : n;
}
const t = (n, e, i) =>
  n.endsWith(`
`)
    ? r(i, e)
    : i.includes(`
`)
      ? `
` + r(i, e)
      : (n.endsWith(' ') ? '' : ' ') + i;
export { r as indentComment, t as lineComment, s as stringifyComment };
